home *** CD-ROM | disk | FTP | other *** search
- ; $VER: UpdateWirenet 1.0 (07.06.96) Amiga Neil Bothwick
- ;
- ; Parts of this installer are based on the installation routines for the
- ; individual software items, the rest is (c) Neil Bothwick, Wirenet Amiga
- ; Internet and may not be used in any other package without permission
-
-
- ;========================== Define Procedures ==========================
-
- (set ArcName 'UpdateWirenet.lzx')
- ;;; Abort with message
- (procedure GetOut GetOutMsg
- (message GetOutMsg)
- (exit (quiet))
- )
- ;;;
- ;;; Check archive was unarced correctly
- (procedure CheckUnarc
- (if (= 0 (exists 'Updates/Dashboard'))
- (GetOut
- (cat
- '\n' ArcName 'has not been unarchived correctly!\n\n'
- 'Type\n\n"unlzx x ' ArcName ' RAM:"\n\nin a shell and then '
- 'double click on the installer icon in RAM:'
- )
- )
- )
- )
- ;;;
- ;;; Get version of program
- (procedure Version filename
- (set vernum (getversion filename))
- (set ver (/ vernum 65536))
- (set rev (- vernum (* ver 65536)))
- (set return ('%ld.%ld' ver rev))
- )
- ;;;
- ;;; Create environment variable
- (procedure SetEnv EnvName EnvVal ; Creates environment variables in ENV: and ENVARC:
- (set ArcName (tackon 'ENVARC:' EnvName))
- (if (exists ArcName) ; Back it up if it already exists,
- (if (not (exists (cat ArcName '.old'))) ; has not been previously backed up
- (if (not(= EnvVal (getenv EnvName))) ; and is not the same value
- (rename ArcName (cat ArcName '.old'))
- )
- )
- )
- (textfile
- (dest (tackon 'ENVARC:' EnvName))
- (append EnvVal)
- )
- (textfile
- (dest (tackon 'ENV:' EnvName))
- (append EnvVal)
- )
- )
- ;;;
- ;;; Install New Dashboard
- (procedure InstallDashboard
- (rename 'AmiTCP:Dashboard' 'AmiTCP:Dashboard.old')
- (copyfiles
- (prompt 'Copying new Dashboard script')
- (help @copyfiles-help)
- (source 'Updates')
- (pattern 'Dashboar#?')
- (dest 'AmiTCP:')
- )
- (protect 'AmiTCP:Dashboard' '+s')
- )
- ;;;
- ;;; Install New Connect
- (procedure InstallConnect
- (rename 'AmiTCP:bin/Connect' 'AmiTCP:bin/Connect.old')
- (copyfiles
- (prompt 'Copying new Connect script')
- (help @copyfiles-help)
- (source 'Updates/Connect')
- (dest 'AmiTCP:bin')
- )
- (protect 'AmiTCP:bin/Connect' '+s')
- )
- ;;;
- ;;; Install Fetch
- (procedure InstallFetch
- (set
- Password
- (askstring
- (prompt '\nPlease enter your password')
- (help @askstring-help)
- )
- )
- (rename 'AmiTCP:bin/Fetch' 'AmiTCP:bin/Fetch.old')
- (textfile
- (dest 'AmiTCP:bin/Fetch')
- (include 'Updates/Fetch.head')
- (append "Password = '" Password "' /* Your email password */\n")
- (include 'Updates/Fetch.body')
- )
- (protect 'AmiTCP:bin/Fetch' '+s')
- )
- ;;;
- ;;; Install SendEvents
- (procedure InstallSendEvents
- (rename 'AmiTCP:bin/SendEvents' 'AmiTCP:bin/SendEvents.old')
- (copyfiles
- (prompt 'Copying new SendEvents script')
- (help @copyfiles-help)
- (source 'Updates/SendEvents')
- (dest 'AmiTCP:bin')
- )
- (protect 'AmiTCP:bin/SendEvents' '+s')
- )
- ;;;
- ;;; Install StopNet
- (procedure InstallStopNet
- (rename 'AmiTCP:bin/StopNet' 'AmiTCP:bin/StopNet.old')
- (copyfiles
- (prompt 'Copying new StopNet script')
- (help @copyfiles-help)
- (source 'Updates/StopNet')
- (dest 'AmiTCP:bin')
- )
- (protect 'AmiTCP:bin/StopNet' '+s')
- )
- ;;;
- ;;; Copy docs
- (procedure CopyDocs
- (copyfiles
- (source 'Updates')
- (dest 'amiTCP:doc')
- (pattern '#?.guide')
- (prompt '')
- (help '')
- )
- )
- ;;;
-
- (CheckUnarc) ; ensure archive was unpacked with paths preserved
- (welcome)
-
- (if (>= (Version 'AmiTCP:Dashboard') (Version 'Updates/Dashboard'))
- (message '\n\nYou already have the latest Dashboard')
- (InstallDashboard)
- )
- (if (>= (Version 'AmiTCP:bin/Connect') (Version 'Updates/Connect'))
- (message '\n\nYou already have the latest Connect')
- (InstallConnect)
- )
- (if (>= (Version 'AmiTCP:bin/Fetch') (Version 'Updates/Fetch.head'))
- (message '\n\nYou already have the latest Fetch')
- (InstallFetch)
- )
- (if (>= (Version 'AmiTCP:bin/SendEvents') (Version 'Updates/SendEvents'))
- (message '\n\nYou already have the latest SendEvents')
- (InstallSendEvents)
- )
- (if (>= (Version 'AmiTCP:doc/Wirenet.guide') (Version 'Updates/Wirenet.guide'))
- (message '\n\nYou already have the latest Wirenet.guide')
- (CopyDocs)
- )
- (InstallStopNet)
- (SetEnv 'MAILSERVER' 'mail.u-net.com')
- (SetEnv 'NEWSSERVER' 'news.u-net.com')
- (SetEnv 'MAILBOX' (cat (getenv 'USERNAME') '-' (getenv 'NODENAME')))
-
- (message '\n\nThe updated Wirenet software has now been installed.')
- (exit (quiet))
-
-